<?php
/*
Template Name: archives
*/
?>
<?php get_header(); ?>
<div class="wrap">
	<div class="main">
<?php if (have_posts()) : the_post(); update_post_caches($posts); ?>
		<div class="post onepage">
			<?php if ( get_the_title() != '' ) : ?>
			<h2><?php the_title(); ?></h2>
			<?php endif;?>
			<div class="content">
				<a id="expand_collapse" href="#">全部展开/收缩</a>
				<div id="archives"><?php archives_list_SHe(); ?></div>
			</div>
		</div>
<script type="text/javascript">
/* 存档页面 jQ伸缩 */
$('#expand_collapse,.archives-yearmonth').css({cursor:"s-resize"});
$('#archives ul li ul.archives-monthlisting').hide();
$('#archives ul li ul.archives-monthlisting:first').show();
$('#archives ul li span.archives-yearmonth').click(function(){$(this).next().slideToggle('fast');return false;});
//以下下是全局的操作
$('#expand_collapse').toggle(
function(){
	$('#archives ul li ul.archives-monthlisting').slideDown('fast');
},
function(){
	$('#archives ul li ul.archives-monthlisting').slideUp('fast');
});
</script>
<?php comments_template(); ?>
<?php endif; ?>
	</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>